<div>
	<div class="main" style="background-color: white;">
		<table class="form-table">
			<tr>
				<th style="width: 230px;">预警库存数：</th>
				<td>
					<input type="text" name="inventory.inventory_warning_count"   value="${inventory.inventory_warning_count!1}" class="input_text validnumber" onkeyup="this.value=this.value.replace(/\D/g,'')" maxlength="5"  onblur="this.value=this.value.replace(/\D/g,'')">
				</td>
			</tr> 
		</table>
	</div>
</div>
<script type="text/javascript">
	$(function(){
		$(".validnumber").blur(function(){
			var _self=$(this);
			var val=_self.val();
			if(isNaN(parseInt(val))){
				alert("您输入的不是数字");
				_self.val(1);
			}else if(parseInt(val)<1){
				alert("设定的值不能小于1");
				_self.val(1);
			}else{
				_self.val(parseInt(val));
			}
		});
	})

</script>

